let app = new Vue({
	el : "#main-content",
	data: {
		maintainList : "",
		status1 : "",
		status2 : "",
		status3 : "",
		status11 : false,
		status22 : false,
		status33 : false,
		pageNum1: 1,
		pageSize: 4
	},
	created() {
		this.getList()
		
	},methods:{
		
		getList(pageNum){
			if(pageNum>0){
				this.pageNum1=pageNum
			}
			let data = new URLSearchParams;
			data.append("pageNum",this.pageNum1);
			data.append("pageSize",3);
			console.log(pageNum);
			axios({
				method : "post",
				url : "xiuli/selectMaintain",
				data : data,
				headers:{"token":localStorage.token,"url":window.location.pathname}
			})
					.then(response =>{
						this.maintainList=response.data.data
						console.log(response);
					})
		},
		paiqian(x,y){
			let data = new URLSearchParams;
			data.append("id",x);
			data.append("status",y);
			axios({
				method : "post",
				url : "xiuli/updataStatus",
				data : data,
				headers:{"token":localStorage.token,"url":window.location.pathname}
			}).then(response=>{
				console.log(response.data);
				if(!response.data.data){
					alert("电工都在忙");
				}
				this.getList()
			})
		},
		fenpei(){
			axios({
				method : "post",
				url : "xiuli/fenpei",
				headers:{"token":localStorage.token,"url":window.location.pathname}
			}).then(response=>{
				console.log(response.data);
			})
		}
		
		
	}
})
